#include<iostream>
using namespace std;
int x,y,gcd;
int GCD(int a,int b){
	int t;
	while(t=a%b){
		a=b;
		b=t;
	}
	return b;
}
int LCM(int a,int b){
	return a*b/GCD(a,b);	
}
int main(){
	scanf("%d %d",&x,&y);
	printf("%d %d\n",GCD(x,y),LCM(x,y));
	return 0;
} 
